package com.triones.ljr.controller.api;

import cn.dev33.satoken.annotation.SaIgnore;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.triones.ljr.entity.vo.BannerVO;
import com.triones.ljr.entity.vo.LawEnforcementVO;
import com.triones.ljr.service.LawEnforcementService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * api - 执法事项
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/zf")
public class ApiLawEnforcementController extends BaseController {

    private final LawEnforcementService lawEnforcementService;

    /**
     * 1：乡镇、2：部门
     * 获取列表
     */
    @SaIgnore
    @GetMapping("/list")
    public R<List<LawEnforcementVO>> list(String category) {
        return R.ok(lawEnforcementService.list(category));
    }

    /**
     * 获取详情
     */
    @GetMapping("/{id}")
    public R<LawEnforcementVO> getInfo(@PathVariable Long id) {
        return R.ok(lawEnforcementService.getInfo(id));
    }
}
